package com.ruoyi.manager.controller;

import com.ruoyi.manager.mapper.TeacherAnalysisMapper;
import com.ruoyi.manager.service.TeachAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@RequestMapping("/manager/analysis")
@Controller
public class AnalysisController {

    @Autowired
    TeachAnalysisService teachAnalysisService;

    @RequestMapping("/teachAnalysisPage")
    public String toTeachAnalysisPage(){
        return "redirect:/analysis/teachAnalysis.html";
    }

    @ResponseBody
    @RequestMapping("/listClssesInfo")
    public List<Map<String,Object>> listClassesInfor(){
        return teachAnalysisService.listClassesInfor();
    }

    @ResponseBody
    @RequestMapping("/listClssesInfo2")
    public List<Map<String,Object>> listClassesInfor2(){
        return teachAnalysisService.listClassesInfor2();
    }

    @ResponseBody
    @RequestMapping("/listClssesInfo3")
    public List<Map<String,Object>> listClassesInfor3(){
        return teachAnalysisService.listClassesInfor3();
    }

    @ResponseBody
    @RequestMapping("/test")
    public Map test(){
        return teachAnalysisService.listStudentLevelCount();
    }

    @ResponseBody //将返回值对象转换成json数据返回
    @RequestMapping("/listClassesAvgScore")
    public List<Map<String,Object>> listClassesAvgScore(){
        return teachAnalysisService.listClassesAvgScore();
    }

    @ResponseBody //将返回值对象转换成json数据返回
    @RequestMapping("/listCS")
    public List<Map<String,Object>> listCS(){
        return teachAnalysisService.listCS();
    }

    @ResponseBody
    @RequestMapping("/scoreInfo")
    public  Map<String,Object> scoreInfo(){
        return teachAnalysisService.scoreInfo();
    }


    @ResponseBody
    @RequestMapping("/exInfo")
    public Map<String,Object> exInfo() {
        return teachAnalysisService.exInfo();
    }

    @ResponseBody //将返回值对象转换成json数据返回
    @RequestMapping("/listExamNumber")
    public List<Map<String,Object>> listExamNumber(){return teachAnalysisService.listExamNumber();};

    @ResponseBody //将返回值对象转换成json数据返回
    @RequestMapping("/exerciseSum")
    public List<Map<String,Object>> exerciseSum(){
        return teachAnalysisService.exerciseSum();
    }

    @ResponseBody //将返回值对象转换成json数据返回
    @RequestMapping("/citySum")
    public List<Map<String,Object>> citySum(){
        return teachAnalysisService.citySum();
    }


}
